<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			*{font-size: 30px;line-height: 1.8;}
		</style>
	</head>
	<body>
		<h1>员工查询</h1>
		<label for="">请输入员工编号：</label>
		<input type="text" id="keyword"/>
		<button id="search">查询</button>
		<p id="searchResult"></p>
		
		<h1>员工创建</h1>
		<label for="">请输入员工姓名：</label>
		<input type="text" id="staffName"/><br />
		<label for="">请输入员工编号：</label>
		<input type="text" id="staffNumber"/><br />
		<label for="">请选择员工性别：</label>
		<select id="staffSex">
			<option>男</option>
			<option>女</option>
		</select><br />
		<label for="">请输入员工职位：</label>
		<input type="text" id="staffJob"/>
		<button id="save">保存</button>
		<p id="createResult"></p>
		<script>
			var oBtn1 = document.getElementById("search");
			var oBtn2 = document.getElementById("save");
			var oP = document.getElementById("searchResult");
			var oText = document.getElementById("keyword");
			oBtn1.onclick = function(){
				//发送和查询请求并处理
				var request = new XMLHttpRequest();
				//request.open("GET","url?number="+oText.value);//取得他得值
				request.open("GET","hello.txt?name="+);
				request.send();
				request.onreadystatechange = function(){
					if(request.readyState == 4&&request.status == 200){
						var data = JSON.parse(request.responseText);
						if(data.success){
							oP.innerHTML = data.msg;
						}else{
							oP.innerHTML = "出现错误"+data.msg;
						}
					}else{
						alert("发生错误"+request.status);
					}
				}
			}
		</script>
	</body>
</html>
